function ajaxSubmit(url,date,type,dataType){
    //console.log(url)
    if (null == type || ""==type){
        type = "POST";
    }
    if (null == dataType || ""==dataType){
        dataType = "json";
    }
    var code = 0;
    $.ajax({
        //几个参数需要注意一下
        type: type,//方法类型
        dataType: dataType,//预期服务器返回的数据类型
        url: url ,//url
        data: date,
        success: function (result) {
            //console.log(result.code)
            code = result.code;
        },
        error : function() {
            code = 1;
        }
    });
    return code;
}